import Vue from 'vue'
import App from './App'
import Vuex from 'vuex'
import VueRouter from 'vue-router'
import { sync } from 'vuex-router-sync'
import routers from './routers'
import store from '@/vuex/store'
import '@/utils/GlobalFuc'

/*import vconsole from 'vconsole'
var c = new vconsole();*/

require('@/assets/style/font-con/iconfont.css')
require('@/plugins/swiper.min.css')
// require('@/plugins/bulma.min.css')
require('@/assets/style/public.less')

require('@/plugins/bootstrap.less')
require('@/plugins/bootstrap-vue.css')


import VueAwesomeSwiper from 'vue-awesome-swiper' //滚动插件
import VueLazyload from 'vue-lazyload' //图片加载

import BootstrapVue from 'bootstrap-vue'
Vue.use(VueAwesomeSwiper)
Vue.use(BootstrapVue)

Vue.use(VueLazyload,{
  error:require('@/assets/images/news_default.png'),
  loading:require('@/assets/images/loading.gif'),
});

 require ("@/plugins/rem/rem.js");


Vue.use(VueRouter)
Vue.use(Vuex)


require('es6-promise').polyfill()


const FastClick = require('fastclick')
FastClick.attach(document.body)


const router = new VueRouter({
  routes: routers,
  //mode: 'history',
  scrollBehavior (to, from, savedPosition) {
    return { x: 0, y: 0 }
  }
});


sync(store, router)


router.beforeEach(function (to, from, next) {
    next()
})

router.afterEach(function (to) {

})

new Vue({
  store,
  router,
  render: h => h(App)
}).$mount('#app')
